package com.ruoyi.video.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.video.mapper.VideoHistoryMapper;
import com.ruoyi.video.domain.VideoHistory;
import com.ruoyi.video.service.IVideoHistoryService;

/**
 * 播放历史Service业务层处理
 *
 * @author ruoyi
 * @date 2022-02-04
 */
@Service
public class VideoHistoryServiceImpl implements IVideoHistoryService {
    @Autowired
    private VideoHistoryMapper videoHistoryMapper;

    /**
     * 查询播放历史
     *
     * @param id 播放历史主键
     * @return 播放历史
     */
    @Override
    public VideoHistory selectVideoHistoryById(String id) {
        return videoHistoryMapper.selectVideoHistoryById(id);
    }

    /**
     * 查询播放历史列表
     *
     * @param videoHistory 播放历史
     * @return 播放历史
     */
    @Override
    public List<VideoHistory> selectVideoHistoryList(VideoHistory videoHistory) {
        return videoHistoryMapper.selectVideoHistoryList(videoHistory);
    }

    /**
     * 新增播放历史
     *
     * @param videoHistory 播放历史
     * @return 结果
     */
    @Override
    public int insertVideoHistory(VideoHistory videoHistory) {
        return videoHistoryMapper.insertVideoHistory(videoHistory);
    }

    /**
     * 修改播放历史
     *
     * @param videoHistory 播放历史
     * @return 结果
     */
    @Override
    public int updateVideoHistory(VideoHistory videoHistory) {
        return videoHistoryMapper.updateVideoHistory(videoHistory);
    }

    /**
     * 批量删除播放历史
     *
     * @param ids 需要删除的播放历史主键
     * @return 结果
     */
    @Override
    public int deleteVideoHistoryByIds(String[] ids) {
        return videoHistoryMapper.deleteVideoHistoryByIds(ids);
    }

    /**
     * 删除播放历史信息
     *
     * @param id 播放历史主键
     * @return 结果
     */
    @Override
    public int deleteVideoHistoryById(String id) {
        return videoHistoryMapper.deleteVideoHistoryById(id);
    }

    @Override
    public VideoHistory selectVideoHistoryByVideoId(String id) {
        return videoHistoryMapper.selectVideoHistoryByVideoId(id);
    }

    @Override
    public int deleteOldVideoHistory(String videoId) {
        return videoHistoryMapper.deleteOldVideoHistory(videoId);
    }
}
